<swal title="Delete?"
      [text]="'Role \'' + role.name + '\' will be deleted permanently. This action cannot be reversed.'"
      type="warning"
      [showCancelButton]="true"
      (confirm)="delete()"
      #deleteAlert>
</swal>
<div class="row">
    <div class="col-12">
        <div class="card m-b-30 m-t-30">
            <div class="card-body">
                <h4 class="mt-0 header-title">Edit Role</h4>
                <p class="text-muted m-b-30 font-14">
                    Here you can modify some properties of a system role.
                </p>
                <form class="needs-validation"
                      [ngClass]="{ 'was-validated': form.submitted }"
                      (ngSubmit)="form.form.valid && update()"
                      novalidate
                      #form="ngForm">
                    <div class="form-group row">
                        <label for="role-name"
                               class="col-sm-2 col-form-label">
                            Name
                        </label>
                        <div class="col-sm-10 col-form-label">
                            <span class="col-form-label"
                                  id="role-name"
                                  name="role-name">
                                {{ role.name }}
                            </span>
                        </div>
                    </div>
                    <div class="form-group row">
                        <label for="role-description"
                               class="col-sm-2 col-form-label">
                            Description
                        </label>
                        <div class="col-sm-10">
                            <textarea id="role-description"
                                      name="role-description"
                                      class="form-control"
                                      rows="3"
                                      maxlength="512"
                                      [(ngModel)]="role.description">
                            </textarea>
                        </div>
                    </div>
                    <div class="form-group">
                        <div>
                            <button type="submit"
                                    class="btn btn-primary m-r-5">
                                <i class="material-icons align-middle">save</i>
                                Save Changes
                            </button>
                            <button type="button"
                                    class="btn btn-danger m-r-5 float-right"
                                    (click)="deleteAlert.fire()">
                                <i class="material-icons align-middle">delete</i>
                                Delete
                            </button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>